package com.travel.JPA;

import com.travel.Bean.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserJPA extends JpaRepository<User,String> {
    @Query("select u from User u where u.userid = ?1 or u.mail = ?1 or u.phone = ?1")
    User findByUsername(String username);

    @Query("select u.mail from User u")
    List<String> findUserMail();

    @Query("select phone from User")
    List<String> findUserPhone();
}
